package com.visikard.item;

import java.io.Serializable;

import org.json.JSONObject;

public class CouponBuilderItem implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	private String merchantName;

	public String getMerchantName() {
		return merchantName;
	}

	public void setMerchantName(String merchantName) {
		this.merchantName = merchantName;
	}

	public long getIdCoupons() {
		return idCoupons;
	}

	public void setIdCoupons(long idCoupons) {
		this.idCoupons = idCoupons;
	}

	public long getFkUser() {
		return fkUser;
	}

	public void setFkUser(long fkUser) {
		this.fkUser = fkUser;
	}

	public long getFkMerchant() {
		return fkMerchant;
	}

	public void setFkMerchant(long fkMerchant) {
		this.fkMerchant = fkMerchant;
	}

	public long getFkCouponType() {
		return fkCouponType;
	}

	public void setFkCouponType(long fkCouponType) {
		this.fkCouponType = fkCouponType;
	}

	public String getCouponName() {
		return couponName;
	}

	public void setCouponName(String couponName) {
		this.couponName = couponName;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public String getImagePreview() {
		return imagePreview;
	}

	public void setImagePreview(String imagePreview) {
		this.imagePreview = imagePreview;
	}

	public String getsDate() {
		return sDate;
	}

	public void setsDate(String sDate) {
		this.sDate = sDate;
	}

	public String geteDate() {
		return eDate;
	}

	public void seteDate(String eDate) {
		this.eDate = eDate;
	}

	public String getExpireDate() {
		return expireDate;
	}

	public void setExpireDate(String expireDate) {
		this.expireDate = expireDate;
	}

	public String getDateCreated() {
		return dateCreated;
	}

	public void setDateCreated(String dateCreated) {
		this.dateCreated = dateCreated;
	}

	public String getLastModified() {
		return lastModified;
	}

	public void setLastModified(String lastModified) {
		this.lastModified = lastModified;
	}

	public int getEnabled() {
		return enabled;
	}

	public void setEnabled(int enabled) {
		this.enabled = enabled;
	}

	public int getPercentOff() {
		return percentOff;
	}

	public void setPercentOff(int percentOff) {
		this.percentOff = percentOff;
	}

	public int getMaxOff() {
		return maxOff;
	}

	public void setMaxOff(int maxOff) {
		this.maxOff = maxOff;
	}

	public String getTermAndCondition() {
		return termAndCondition;
	}

	public void setTermAndCondition(String termAndCondition) {
		this.termAndCondition = termAndCondition;
	}

	private long idCoupons;
	private long fkUser;
	private long fkMerchant;
	private long fkCouponType;
	private String couponName;
	private String description;
	private String image;
	private String imagePreview;

	private String sDate;
	private String eDate;
	private String expireDate;
	private String dateCreated;
	private String lastModified;

	private int enabled;
	private int percentOff;
	private int maxOff;
	private String termAndCondition;

	public CouponBuilderItem(JSONObject job) {
		if (job == null)
			return;

		try {
			merchantName = job.optString("merchantName", "");
			idCoupons = job.optLong("idCoupons", -1);
			fkUser = job.optLong("fkUser", -1);
			fkMerchant = job.optLong("fkMerchant", -1);
			fkCouponType = job.optLong("fkCouponType", -1);

			couponName = job.optString("couponName", "");
			if (couponName == null || couponName.equals("null"))
				couponName = "";

			description = job.optString("description", "");
			if (description == null || description.equals("null"))
				description = "";

			image = job.optString("image", "");
			if (image == null || image.equals("null"))
				image = "";

			imagePreview = job.optString("imagePreview", "");
			if (imagePreview == null || imagePreview.equals("null"))
				imagePreview = "";

			sDate = job.optString("sDate", "");
			if (sDate == null || sDate.equals("null"))
				sDate = "";

			eDate = job.optString("eDate", "");
			if (eDate == null || eDate.equals("null"))
				eDate = "";

			expireDate = job.optString("expireDate", "");
			if (expireDate == null || expireDate.equals("null"))
				expireDate = "";

			dateCreated = job.optString("dateCreated", "");
			if (dateCreated == null || dateCreated.equals("null"))
				dateCreated = "";

			enabled = job.optInt("enabled", 0);

			percentOff = job.optInt("percentOff", 0);
			maxOff = job.optInt("maxOff", 0);

			couponName = job.optString("couponName", "0");
			if (couponName == null || couponName.equals("null"))
				couponName = "0";
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}

}
